using Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace ELF.Infrastructure.Data.Configurations;

public class TagConfiguration : IEntityTypeConfiguration<Tag>
{
    public void Configure(EntityTypeBuilder<Tag> builder)
    {
        builder.HasKey(t => t.Id);
        builder.Property(t => t.Id).ValueGeneratedNever();

        builder.Property(t => t.Name)
            .HasMaxLength(50)
            .IsRequired()
            ;
        builder.Property(t => t.Slug)
            .HasMaxLength(50)
            .IsRequired()
            ;
        builder.Property(t => t.Desc)
            .HasMaxLength(100)
            .IsRequired()
            ;
    }
}